package com.example.administrator.xiaoxiang.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.example.administrator.xiaoxiang.R;

public class XiaoGuoActivity extends Activity {
    private ImageView mImageView;
    private int image[] = new int[]{
            R.mipmap.loadingshow_img1,
            R.mipmap.loadingshow_img2,
            R.mipmap.loadingshow_img3,
            R.mipmap.loadingshow_img4,
            R.mipmap.loadingshow_img5,
    };
    private int count;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_xiao_guo);
        mImageView= (ImageView) findViewById(R.id.Imge_Xiao);
        mImageView.setImageResource(image[0]);
        intOnclick();
    }

    private void intOnclick() {
        mImageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                count++;
                mImageView.setImageResource(image[count]);
                if(count==4){
                    startActivity(new Intent(XiaoGuoActivity.this,MainActivity.class));
                    finish();
                }
            }
        });
    }
}
